package com.example.mementopattern.entity;

/**
 * @author ash
 * @description
 * @create 2023/2/17  0:16:30
 * @className Originator
 * @verson 1.0.0
 */
public class Originator {

    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento createMemento(){
        return new Memento(this.state);
    }

    public void setMemento(Memento memento){
       this.state = memento.getState();
    }

    public void show(){
        System.out.println(this.state);
    }
}
